You are here: Statements and Functions > TimesUsed()
Syntax samples
TIMESUSED(<resource>)
IF TIMESUSED(Res1) > 5 then USE Res2 for 10
Returns the number of times a resource has been used.
Any logic and any field evaluated after translation. For a list of fields evaluated after translation, see the Appendix A.
Components
<resource>
The name of the resource to examine. RES() may be used here.
Example
In the example below, when an EntA arrives at Loc1, it will only use the resource Res1 if the resource has been used five or fewer times. If the resource has been used more than five times, EntA will use Res2 instead.
Process Table
Entity |
Location |
Operation (min) |
---|---|---|
EntA |
Loc1 |
IF TIMESUSED (Res1)> 5 THEN USE Res2 FOR 10 ELSE USE Res1 FOR 10 |
Routing Table
Blk |
Output |
Destination |
Rule |
Move Logic |
---|---|---|---|---|
|
|
|
|
|
UNITS().